/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package eu.horyzont.systemyrozproszone.systemmagazynowy.serwer.entities;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
/**
 *
 * @author Maciej
 */
public class Order extends Entity {
    private Employee employee;
    private Contractor contractor;
    private final  List<OrderItem> orderItemList=new ArrayList<OrderItem>(); //to tak ma wyglądać?
    private GregorianCalendar orderDate;
    private double sum;
    
    
    public void setEmployee(Employee employee){
        this.employee=employee;
        
    }
    public Employee getEmployee(){
        return employee;
    }
    
    public void setContractor(Contractor contractor){
        this.contractor=contractor;
    }
    
    public Contractor getContractor(){
        return contractor;
    }
    
    public void addOrderItem(OrderItem orderItem){
        orderItemList.add(orderItem);
    }
    public void removeOrderItem(OrderItem orderItem){
        orderItemList.remove(orderItem);
    }
    public String orderItemListToString(){ //może się przydać
       return orderItemList.toString();
    }
    
    public void setOrderDate(int day,int month, int year){
        orderDate.set(year,month,day);
    }
    public String getOrderDate(){
        return ""+orderDate.get(2)+" "+orderDate.get(1)+" "+orderDate.get(0);
    }
    
    public void setSum(double sum){
        this.sum=sum;
    }
    public double getSum(){
        return sum;
    }

    }
    
    

